
import xlrd


def get_info():
    global info_dict, address
    wb = xlrd.open_workbook(r'/home/m/2021年推荐入团积极分子名单(1).xls')
    ws = wb.sheet_by_name('member_info')
    info_list = ['bh', 'class', 'name', 'sfzh', 'address', 'telephone']
    # for rows in range(1, ws.nrows):
    #     mem_list = [ws.row(rows)[i].value for i in range(ws.ncols - 1)]
    #     info_dict = {info: mem for info, mem in zip(info_list, mem_list)}
    #
    #     print(info_dict)
    for i in ws.col(4):
        if '安阳' not in i.value and '内黄' not in i.value:
            address='内黄县'+i.value
        else:
            address=i.value
        if '河南' not in address:
            new_address='河南省'+address
        else:
            new_address=address
        i.value=new_address
        print(new_address)




if __name__ == '__main__':
    get_info()